- OptionT <M, A> (K<M, Option<A>> runOption)
- Some (A value)
- None = Lift(Option<A>.None)
- Lift (Pure<A> monad)
- Lift (Option<A> monad)
- Lift (Fail<Unit> monad)
- Lift (K<M, A> monad)
- Lift (K<M, Option<A>> monad)
- LiftIO (IO<A> monad)
- LiftIO (IO<Option<A>> monad)
- Match <B> (Func<A, B> Some, Func<B> None)
- Match (Action<A> Some, Action None)
- IfSome (Action<A> f)
- IfSome (Func<A, Unit> f)
- IfNone (Func<A> None)
- IfNone (Action None)
- IfNone (A noneValue)
- Run ()
- MapT <M1, B> (Func<K<M, Option<A>>, K<M1, Option<B>>> f)
- MapM <B> (Func<K<M, A>, K<M, B>> f)
- Map <B> (Func<A, B> f)
- Select <B> (Func<A, B> f)
- Bind <B> (Func<A, K<OptionT<M>, B>> f)
- Bind <B> (Func<A, OptionT<M, B>> f)
- Bind <B> (Func<A, IO<B>> f)
- Bind <B> (Func<A, Pure<B>> f)
- SelectMany <B, C> (Func<A, K<OptionT<M>, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, OptionT<M, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Option<B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project)
- ToEither <L> (L left)
- ToEither <L> (Func<L> left)
- ToEither <L> ()
- OptionTExt
- As <M, A> (this K<OptionT<M>, A> ma)
- Flatten <A> (this Task<OptionT<IO, A>> tma)
- ToIO <A> (this Task<Option<A>> ma)
- Flatten <M, A> (this OptionT<M, OptionT<M, A>> mma)
- SelectMany <M, A, B, C> ( this K<M, A> ma, Func<A, K<OptionT<M>, B>> bind, Func<A, B, C> project)
- SelectMany <M, A, B, C> ( this K<M, A> ma, Func<A, OptionT<M, B>> bind, Func<A, B, C> project)
- Apply <M, A, B> (this OptionT<M, Func<A, B>> mf, OptionT<M, A> ma)
- Action <M, A, B> (this OptionT<M, A> ma, OptionT<M, B> mb)
- OptionT <M>
- Some <A> (A value)
- None <A> ()
- lift <A> (Option<A> ma)
- lift <A> (Pure<A> ma)
- lift <A> (Fail<Unit> ma)
- liftIO <A> (IO<A> ma)
- OptionT
- bind <M, A, B> (OptionT<M, A> ma, Func<A, OptionT<M, B>> f)
- map <M, A, B> (Func<A, B> f, OptionT<M, A> ma)
- Some <M, A> (A value)
- None <M, A> ()
- apply <M, A, B> (OptionT<M, Func<A, B>> mf, OptionT<M, A> ma)
- action <M, A, B> (OptionT<M, A> ma, OptionT<M, B> mb)
- lift <M, A> (Option<A> ma)
- lift <M, A> (K<M, A> ma)
- lift <M, A> (Pure<A> ma)
- lift <M, A> (Fail<Unit> ma)
- liftIO <M, A> (IO<A> ma)
- match <M, A, B> (OptionT<M, A> ma, Func<A, B> Some, Func<B> None)
- OptionT <M>
record OptionT <M, A> (K<M, Option<A>> runOption) Source #
OptionT
monad transformer, which allows for an optional result.
type | M | Given monad trait |
type | A | Bound value type |
param | runOption | Transducer that represents the transformer operation |
field OptionT<M, A> None = Lift(Option<A>.None) Source #
Lift a pure value into the monad-transformer
param | value | Value to lift |
returns |
|
method OptionT<M, A> Some (A value) Source #
Lift a pure value into the monad-transformer
param | value | Value to lift |
returns |
|
method OptionT<M, A> Lift (Pure<A> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method OptionT<M, A> Lift (Option<A> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method OptionT<M, A> Lift (Fail<Unit> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method OptionT<M, A> Lift (K<M, A> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method OptionT<M, A> Lift (K<M, Option<A>> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method OptionT<M, A> LiftIO (IO<A> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method OptionT<M, A> LiftIO (IO<Option<A>> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method K<M, B> Match <B> (Func<A, B> Some, Func<B> None) Source #
Match the two states of the Option and return a B, which can be null.
type | B | Return type |
param | Some | Some match operation. May return null. |
param | None | None match operation. May return null. |
returns | B, or null |
method K<M, Unit> Match (Action<A> Some, Action None) Source #
Match the two states of the Option
param | Some | Some match operation |
param | None | None match operation |
method K<M, Unit> IfSome (Action<A> f) Source #
Invokes the action if Option is in the Some state, otherwise nothing happens.
param | f | Action to invoke if Option is in the Some state |
method K<M, Unit> IfSome (Func<A, Unit> f) Source #
Invokes the f function if Option is in the Some state, otherwise nothing happens.
param | f | Function to invoke if Option is in the Some state |
method K<M, A> IfNone (Func<A> None) Source #
Returns the result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null return value from the None operation
param | None | Operation to invoke if the structure is in a None state |
returns | Result of invoking the None() operation if the optional is in a None state, otherwise the bound Some(x) value is returned. |
method K<M, Unit> IfNone (Action None) Source #
Invokes the action if Option is in the None state, otherwise nothing happens.
param | f | Action to invoke if Option is in the None state |
method K<M, A> IfNone (A noneValue) Source #
Returns the noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned.
Will not accept a null noneValue
param | noneValue | Value to return if in a None state |
returns | noneValue if the optional is in a None state, otherwise the bound Some(x) value is returned |
method K<M, Option<A>> Run () Source #
Runs the OptionT exposing the outer monad with an inner wrapped Option
method OptionT<M1, B> MapT <M1, B> (Func<K<M, Option<A>>, K<M1, Option<B>>> f) Source #
Maps the bound monad
type | M1 | Target monad type |
type | B | Target bound value type |
param | f | Mapping function |
returns | Mapped monad |
method OptionT<M, B> MapM <B> (Func<K<M, A>, K<M, B>> f) Source #
Maps the given monad
param | f | Mapping function |
method OptionT<M, B> Map <B> (Func<A, B> f) Source #
Maps the bound value
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method OptionT<M, B> Select <B> (Func<A, B> f) Source #
Maps the bound value
type | B | Target bound value type |
param | f | Mapping transducer |
returns |
|
method OptionT<M, B> Bind <B> (Func<A, K<OptionT<M>, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method OptionT<M, B> Bind <B> (Func<A, OptionT<M, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method OptionT<M, B> Bind <B> (Func<A, IO<B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method OptionT<M, B> Bind <B> (Func<A, Pure<B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method OptionT<M, C> SelectMany <B, C> (Func<A, K<OptionT<M>, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method OptionT<M, C> SelectMany <B, C> (Func<A, OptionT<M, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method OptionT<M, C> SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method OptionT<M, C> SelectMany <B, C> (Func<A, Option<B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method OptionT<M, C> SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method OptionT<M, C> SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
class OptionTExt Source #
Option monad extensions
method OptionT<IO, A> Flatten <A> (this Task<OptionT<IO, A>> tma) Source #
Get the outer task and wrap it up in a new IO within the OptionT IO
method OptionT<M, A> Flatten <M, A> (this OptionT<M, OptionT<M, A>> mma) Source #
Monadic join
method OptionT<M, C> SelectMany <M, A, B, C> ( this K<M, A> ma, Func<A, K<OptionT<M>, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method OptionT<M, C> SelectMany <M, A, B, C> ( this K<M, A> ma, Func<A, OptionT<M, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method OptionT<M, B> bind <M, A, B> (OptionT<M, A> ma, Func<A, OptionT<M, B>> f) Source #
method OptionT<M, B> apply <M, A, B> (OptionT<M, Func<A, B>> mf, OptionT<M, A> ma) Source #